<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Coupon extends Model  {

	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'coupon';
	protected $primaryKey  ='coupon_id';

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    /**
     * Indicates if the primary key should be incrementing.
     *
     * @var bool
     */
    //protected $incrementing =false;

    /**
     * The storage format of the model's date columns.
     *
     * @var string
     */
    //protected $dateFormat = 'U';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    //protected $fillable = ['name'];

    /**
     * The attributes that aren't mass assignable.
     *
     * @var array
     */
    //protected $guarded = ['price'];

    //use SoftDeletes;

    /**
     * The attributes that should be mutated to dates.
     *
     * @var array
     */
    //protected $dates = ['deleted_at'];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = ['store_id', 'if_receive', 'receive_times', 'coupon_logo'];

    public function coupons(){
        return $this->hasMany('App\Models\CouponSn','coupon_id','coupon_id');
    }
}
